﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LaserAutoTest.Common
{
    public static class DecimalExtension
    {
        public static string DToString(this decimal? d)
        {
            if (d == null)
                return string.Empty;
            else
                return d.Value.ToString();
        }

        public static string Round(this decimal d,int digit,MidpointRounding midpointRounding = MidpointRounding.AwayFromZero)
        {
            return decimal.Round(d, digit, midpointRounding).ToString();
        }
    }
}
